Conversation
|
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
| for (const lookup of lookupOrder) { | ||
| const prismaFilter = buildPrismaFilter({ [lookup.field]: lookup.value }); | ||
| // eslint-disable-next-line no-await-in-loop | ||
| entity = await this.prisma.group.findFirst(prismaFilter); |
There was a problem hiding this comment.
[performance]
Using await inside a loop can lead to performance issues because it waits for each promise to resolve before continuing to the next iteration. Consider using Promise.all to execute these operations concurrently if they are independent.
| if (!entity) { | ||
| throw new NotFoundException(`Not found group of id ${groupId}`); | ||
| const identifier = oldId ?? groupId ?? ''; | ||
| throw new NotFoundException(`Not group found with id or oldId: ${identifier}`); |
There was a problem hiding this comment.
[💡 correctness]
The error message in NotFoundException has a typo: 'Not group found' should be 'No group found'.
https://topcoder.atlassian.net/browse/PS-435